import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import WindiCSS from 'vite-plugin-windicss'
import path from "path"

// https://vite.dev/config/
export default defineConfig({
  transpileDependencies: true,
  resolve: {
    alias: {
      "~": path.resolve(__dirname, "src")
    }
  },
  server: {
    port: 9102,
    host: "0.0.0.0",
    proxy: {
      '/api': {
        target: 'http://172.16.1.228:9100',
        changeOrigin: true,
        secure: false,
        // rewrite: (path) => path.replace(/^\/api/, ""),
      },
    }
  },
  plugins: [vue(), WindiCSS()],
  css: {
    preprocessorOptions: {
      scss: {
        additionalData: `@import "@/styles/variables.scss";`
      }
    }
  }
})
